<template>
<div v-if="filminfo">
 <h2>{{filminfo.name}}</h2>
  <img :src="filminfo.poster" class="poster">
</div>
</template>
<script>
import axios from "axios";
import ddp from "./Film/ddp";
import wrr from "./Film/wrr";
export default {
  name: "Detail",
  data(){
    return{
      filminfo:null
    }
  },
components:{
    ddp,
  wrr
},
  props:['id'],
  beforeMount() {
    // this.$store.state.isTabbarShow = false
    console.log("isTabber")
    this.$store.commit("isTabber",true);
  },
  mounted() {
    // console.log('要获取详情信息',this.$route.params.id,this.id)
    axios({
      url:`https://m.maizuo.com/gateway?filmId=${this.$route.params.id}&k=7735779`,
      headers:{
        'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.0.4","e":"16200862756251397913772033","bc":"110100"}',
        'X-Host': 'mall.film-ticket.film.info'
      }

    }).then(res=>{
      // console.log(res.data)
      this.filminfo = res.data.data.film
    })
    console.log("获取Detail")
    // this.$route.path("/Detail")
    // if(判断是不是Detail路由){
    //   this.iswe =true
    // }else {
    //   this.iswe =false
    // }
  },
  beforeDestroy() {
    console.log("showtabber")
    // this.$store.state.isTabbarShow = true
    this.$store.commit("showtabber",true);
  }

}
</script>

<style scoped>
.poster{
  width: 100% ;
}
</style>
